package GUI;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;

import logic.Message;

import org.apache.commons.io.FileUtils;

import server.PDFViewer;

public class pdfView {

	public pdfView(Message msg) {
		
		ArrayList<Object> data = msg.GetMessageData(); 
		
		
		byte[] byteArray = (byte[])(data.get(1));
		String indexPath = "INDEXES2/" + (Integer)data.get(0) + ".pdf";
		File f = new File(indexPath);
		try {
			FileUtils.writeByteArrayToFile(f, byteArray);
		} catch (IOException e) {
			return;
		}
		
		PDFViewer pdf = new PDFViewer(indexPath);
	}

}
